<template>
  <el-config-provider :locale="locale" :button="button" :message="message">
    <router-view v-slot="{ Component }">
      <!-- <transition name="el-fade-in-linear"> -->
      <component :is="Component" />
      <!-- </transition> -->
    </router-view>
  </el-config-provider>
</template>

<script setup lang="ts">
import zhCn from 'element-plus/es/locale/lang/zh-cn'
import en from 'element-plus/es/locale/lang/en'
const language = ref('zh-cn')
const locale = computed(() => (language.value === 'zh-cn' ? zhCn : en))
const button = reactive({
  autoInsertSpace: true,
})
const message = reactive({
  max: 3,
})
onMounted(() => {
  // console.log('App mounted')
  // document.onkeyup = function (event) {
  //   if (event.key === ' ') {
  //     language.value = language.value === 'zh-cn' ? 'en' : 'zh-cn'
  //     ElMessage.success({
  //       message: '切换语言成功',
  //       type: 'success',
  //     })
  //   }
  // }
})
</script>

<style lang="scss"></style>
